#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

//写两个函数，一个排序，一个打印（用迭代器）
void asort(vector<vector<int>> &array){
    for(int i = 0; i < array.size(); ++i){
        sort(array[i].begin(), array[i].end());
    }
    //return array;
}

void print(vector<vector<int>> array){
    for(vector<vector<int>>::iterator iter = array.begin(); iter != array.end(); ++iter){
        for(vector<int>::iterator iter1 = (*iter).begin(); iter1 != (*iter).end(); ++iter1){
            cout << *iter1 << " "; 
        }
        cout << endl;
    }
}

int main(int argc, char const *argv[])
{
    vector<vector<int>> array{
        {90, 5,  7,  3,  9, 12, 56},
        {10, 2,  9,  3,  8, 16, 89, 102},
        {31, 56, 16, 91, 22}
    };

    asort(array);

    print(array);
    return 0;
}